package com.data.center.service.impl;


import com.data.center.dto.StaffDto;
import com.data.center.entity.Staff;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.lang.reflect.InvocationTargetException;

import static org.mockito.Mockito.when;


@SpringBootTest
@Slf4j
public class StaffServiceImplTestSC {

    @Test
    public void testStandardizeStaff() throws IllegalAccessException, InvocationTargetException {
        // Create a StaffDto object
        StaffDto staffDto = new StaffDto();
        staffDto.setStaffId("123456789123456789123456789123456789123456789");
        staffDto.setName("John");

        StaffServiceImpl service = new StaffServiceImpl();
        // Call the standardizeStaff method
        StaffDto staff = service.standardizeStaff(staffDto);

        // Assert that the properties are copied correctly
        Assert.assertEquals("John", staff.getName());
        Assert.assertEquals("S1234567891234567891234567891234", staff.getStaffId());
    }

    @Autowired
    private StaffServiceImpl staffService;

    @Test
    public void testaddStaff() throws InvocationTargetException, IllegalAccessException {
        StaffDto staffDto = new StaffDto();
        staffDto.setName("测试2");
        staffService.addStaff(staffDto);
    }
}